
public class Units {

	public
		enum Dunits { mcgmin, mcghr, mgmin, mghr }
		Dunits dunits;
		
		Units(Dunits c){
			dunits = c;
		}
		public String toString()
		{
			switch(dunits) {
				case mcgmin:
					return "mcg/min";
				case mcghr:
					return "mcg/hr";
				case mgmin:
					return "mg/min";
				case mghr:
					return "mg/hr";
				default:
					return "error";
			}
		}
		double tomcghr() {
			if (dunits == Dunits.mcghr) {
				return 1;
			} else if (dunits == Dunits.mcgmin) {
				return 60;
			} else if (dunits == Dunits.mgmin) {
				return (60*1000);
			} else {
				return 1000;
			}
		}
}
